////////Add New table -- -- Table structure for table `ibwf_favtopic` -- CREATE TABLE IF NOT EXISTS `ibwf_favtopic` ( `id` int(100) NOT NULL AUTO_INCREMENT, `tid` int(100) NOT NULL DEFAULT '0', `uid` int(100) NOT NULL DEFAULT '0', `dtpost` int(100) NOT NULL DEFAULT '0', PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=36 ; -- -- Dumping data for table `ibwf_favtopic` -- ///////////////index.php if($action=="viewuser") $unol2 = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_favtopic WHERE uid='".$who."'")); $plink = "$unol2[0]"; echo "Favourite Topic: $plink
"; if($action=="viewtpc") $vp = mysql_fetch_array(mysql_query("SELECT tid FROM ibwf_favtopic WHERE uid='".$uid."'")); if($tid==$vp[0]) { echo "Delete From Favourite list
"; }else{ echo "Make Favourite
"; } //////////////genproc.php ////////Make Favt Topic else if($action=="makefav") { $tid = $_GET["tid"]; $qut = $_POST["qut"]; $who = $_GET["who"]; $user = getnick_uid($who); $crdate = time(); $fid = getfid($tid); echo ""; echo "

"; $pt = mysql_fetch_array(mysql_query("SELECT tid FROM ibwf_favtopic WHERE id='".$uid."'")); if($tid==$pt[0]) { echo ""; } else { $vp = mysql_fetch_array(mysql_query("SELECT tid FROM ibwf_favtopic WHERE uid='".$uid."'")); if($tid==$vp[0]) { echo " Already Added in your favourite topic list!!
"; }else{ $res = mysql_query("INSERT INTO ibwf_favtopic SET tid='".$tid."', uid='".$uid."', dtpost='".$crdate."'"); } if($res) { echo "\"O\"/This topic Added in your Favourite list successfully
"; }else{ echo "\"X\"/Error
"; } } $tinfo = mysql_fetch_array(mysql_query("SELECT name, text, authorid, crdate, views, fid, pollid from ibwf_topics WHERE id='".$tid."'")); $tnm = htmlspecialchars($tinfo[0]); echo "Back to $tnm
"; echo "\"\"/Home"; echo "© Mukt@r
"; echo "

"; echo "
"; } ////////Delete Topic From Favt. List else if($action=="delfav") { $tid = $_GET["tid"]; $qut = $_POST["qut"]; $who = $_GET["who"]; $user = getnick_uid($who); $crdate = time(); $fid = getfid($tid); echo ""; echo "

"; $pt = mysql_fetch_array(mysql_query("SELECT tid FROM ibwf_favtopic WHERE id='".$uid."'")); if($tid==$pt[0]) { echo ""; } else { $vp = mysql_fetch_array(mysql_query("SELECT tid FROM ibwf_favtopic WHERE uid='".$uid."'")); if($tid==$vp[0]) { $res = mysql_query("DELETE FROM ibwf_favtopic WHERE tid='".$tid."' AND uid='".$uid."'"); }else{ echo " Already Deleted from your favourite topic list!!
"; } if($res) { echo "\"O\"/This topic Deleted From your Favourite topic list successfully
"; }else{ echo "\"X\"/Error
"; } } $tinfo = mysql_fetch_array(mysql_query("SELECT name, text, authorid, crdate, views, fid, pollid from ibwf_topics WHERE id='".$tid."'")); $tnm = htmlspecialchars($tinfo[0]); echo "Back to $tnm
"; echo "\"\"/Home"; echo "© Mukt@r
"; echo "

"; echo "
"; } //////////////////////lists.php //////////////////////////////////view favt topic list else if($action=="favttopic") { $who = $_GET["who"]; addonline(getuid_sid($sid),"Viewing Users Favourite Topic",""); echo ""; $tid = $_GET["tid"]; //////ALL LISTS SCRIPT << if($page=="" || $page<=0)$page=1; $noi = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_favtopic WHERE uid='".$who."'")); $num_items = $noi[0]; //changable $items_per_page= 10; $num_pages = ceil($num_items/$items_per_page); if(($page>$num_pages)&&$page!=1)$page= $num_pages; $limit_start = ($page-1)*$items_per_page; //changable sql $sql = "SELECT id ,tid, dtpost FROM ibwf_favtopic WHERE uid='".$who."'ORDER BY dtpost DESC LIMIT $limit_start, $items_per_page"; echo "

"; $items = mysql_query($sql); echo mysql_error(); if(mysql_num_rows($items)>0) { while ($item = mysql_fetch_array($items)) { $tid = gettid_pid($item[1]); $tname = gettname($tid); $tinfo = mysql_fetch_array(mysql_query("SELECT name, text, authorid, crdate, views, fid, pollid from ibwf_topics WHERE id='".$item[1]."'")); $tnm = htmlspecialchars($tinfo[0]); echo ""; $lnk = "[x]
"; echo "".htmlspecialchars($tnm)." ".date("d m y-H:i:s",$item[2])." $lnk
"; } } echo "

"; echo "

"; if($page>1) { $ppage = $page-1; echo "«PREV "; } if($page<$num_pages) { $npage = $page+1; echo "Next»"; } echo "
$page/$num_pages
"; if($num_pages>2) { $rets = "Jump to page"; $rets .= "[GO]"; $rets .= ""; $rets .= ""; $rets .= ""; $rets .= ""; $rets .= ""; $rets .= ""; echo $rets; } echo "

"; ////// UNTILL HERE >> echo "

"; $unick = getnick_uid($who); echo ""; echo "$unick's Profile
"; echo "\"*\"/"; echo "© Mukt@r
"; echo "Home
"; echo "

"; echo "
"; }